//
//  CLNavigationProtocol.h
//  CLBrowser
//
//  Created by 梁慧聪 on 2021/7/9.
//  关于导航栏跳转（Push/Pop   Present/Dismiss）的协议

#import <Foundation/Foundation.h>
#import "CLViewModel.h"
#import "CLViewController.h"
//NS_ASSUME_NONNULL_BEGIN
@protocol CLNavigationProtocol <NSObject>
/// Pushes the corresponding view controller.
///
/// Uses a horizontal slide transition.
/// Has no effect if the corresponding view controller is already in the stack.
///
/// viewModel - the view model
/// animated  - use animation or not
- (void)pushViewModel:(CLViewModel *_Nullable)viewModel animated:(BOOL)animated;

/// Pops the top view controller in the stack.
///
/// animated - use animation or not
- (void)popViewModelAnimated:(BOOL)animated;

/// Pops until there's only a single view controller left on the stack.
///
/// animated - use animation or not
- (void)popToRootViewModelAnimated:(BOOL)animated;

/// Present the corresponding view controller.
///
/// viewModel  - the view model
/// animated   - use animation or not
/// completion - the completion handler
- (void)presentViewModel:(CLViewModel *_Nullable)viewModel animated:(BOOL)animated completion:(VoidBlock _Nullable)completion;

/// Dismiss the presented view controller.
///
/// animated   - use animation or not
/// completion - the completion handler
- (void)dismissViewModelAnimated:(BOOL)animated completion:(VoidBlock _Nullable )completion;

/// Reset the corresponding view controller as the root view controller of the application's window.
///
/// viewModel - the view model
- (void)resetRootViewModel:(CLViewModel * _Nullable)viewModel;

- (void)pushController:(CLViewController * _Nullable)viewController animated:(BOOL)animated;

- (void)popControllerAnimated:(BOOL)animated;

- (void)popToRootControllerAnimated:(BOOL)animated;

- (void)presentViewController:(UIViewController * _Nullable)viewController animated:(BOOL)animated completion:(VoidBlock _Nullable)completion;

- (void)dismissControllerAnimated:(BOOL)animated completion:(VoidBlock _Nullable)completion;

- (void)resetRootController:(CLViewController * _Nullable)viewController;

- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion;
@end

//NS_ASSUME_NONNULL_END
